# 定义编译器  
CC=arm-linux-gnueabihf-gcc  
  
# 定义包含目录  
INCLUDES=-I include -I /home/yong/my_for_raspberry/mosquitto-2.0.15/include   -I /home/yong/my_for_raspberry/cJSON-1.7.14   -I /home/yong/my_modbus/libmodbus-3.1.10/install/include/modbus  
  
# 定义库目录  
LIBS=-L /home/yong/my_modbus/libmodbus-3.1.10/install/lib   -L /home/yong/my_for_raspberry/mosquitto-2.0.15/src   -L /home/yong/my_for_raspberry/openssl-1.1.1v/openssl-1.1.1a_install/lib -L /home/yong/my_for_raspberry/cJSON-1.7.14  
  
# 定义链接时需要的库  
LDLIBS=-lmosquitto -lssl -lcrypto -lcjson -lmodbus  
  
# 定义源文件  
SRC=lib/can_rx.c  lib/can_tx.c   mqtt_over/mosquitto_modbus_can.c  
  
# 定义目标文件（可执行文件）  
TARGET=mqtt_over/mosquitto_modbus_can  
  
# 默认目标：编译并链接程序  
all: $(TARGET)  
  
# 链接规则  
$(TARGET): $(SRC)  
	$(CC) $(SRC) -o $(TARGET) $(INCLUDES) $(LIBS) $(LDLIBS)  
  
# 清理编译生成的文件  
clean:  
	rm -f $(TARGET)  
  
# 依赖项可以进一步细化，但这里为了简化而省略
